import request from '@/utils/request';

// 获取权限树
export function getSystemTree(): Promise<any> {
  return request('/api/auth/module/list', { method: 'GET' });
}

// 新增功能权限模块
export function addModule(data: object): Promise<any> {
  return request('/api/auth/module', {
    method: 'POST',
    data,
  });
}

// 修改功能权限模块
export function updateModule(id: string, data: object): Promise<any> {
  return request(`/api/auth/module/${id}`, {
    method: 'PUT',
    data,
  });
}

// 删除功能权限模块
export function deleteModule(id: string): Promise<any> {
  return request(`/api/auth/module/${id}`, { method: 'DELETE' });
}
